<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			/*数组原型新增方法*/
			Array.prototype.removeByValue = function(val) {
				console.log(val); // val指向传进来的参数
				console.log(this); //this指向原始数组
				for(var i = 0; i < this.length; i++) {
					if(this[i] == val) {
						this.splice(i, 1);
						break;
					}
				}
			};
			var arr = [0,1,2,3,4,5,6,"jk"]
			arr.removeByValue(arr[2]);
			console.log(arr);
		</script>
	</body>

</html>